package com.sxfq.loansupermarket.backsystem.common;

/**
 * Created by GX on 2017/9/2.
 */
public class UserConstant {

    /**
     * 未删除用户FLAG值
     */
    public final static int FLAG_USER = 1;

    /**
     * 注册用户密码长度规则
     */
    public final static int PWD_LENGTH = 6;

    /**
     * token失效时间,单位:分钟
     */
    public final static int EXPIRED_TIME = 60*60*24*7;




    /**
     * 当前用户的token保存key值前缀,拼接上用户ID后,可以在cache里面通过get(key)方法获取该用户的token值
     */
    public final static String CUR_USER_TOKEN_KEY = "$loanapp_cur_user_token_key_";
    public static String genKey(long phone){
        return CUR_USER_TOKEN_KEY + phone;
    }

    /**
     * 登录安全校验
     */
    public final static String security = "23$@adf#@!!";

    /**
     * 短信验证码的 redis key
     */
    public final static String PHONE_CODE_KEY = "$phone_code_key_";
    public static String genPhoneCodeKey(String phone){return PHONE_CODE_KEY + phone;}

    /**
     * 短信验证码是否发送过的 redis key
     */
    public final static String PHONE_CODE_SEND_KEY = "$phone_code_send_key_";
    public static String genPhoneCodeSendKey(String phone){return PHONE_CODE_SEND_KEY + phone;}

    /**
     * 短信验证码每天发送次数的 redis key
     */
    public final static String PHONE_CODE_COUNT_KEY = "$phone_code_count_key_";
    public static String genPhoneCodeCountKey(String phone){return PHONE_CODE_COUNT_KEY + phone;}

    /**
     * 是否支持分期的key
     */
    public final static String SUPPORT_MULTI_KEY = "$support_multi_key_";
    public static String genSupportKey(String phone){return SUPPORT_MULTI_KEY + phone;}


    /**
     * 登入用户key PID后缀，用于记录登入用户点击量，自然天，点击多次，也只能算一次
     */
	 public final static String redis_login_tizi = "token3:login_tizi";

    public static String gen2Key(String phone){return redis_login_tizi+ phone;}
	 

    public final static String Login_reads_Count_key = "loginReadsCount:Login_reads_Count_key";
    public static String gen1Key(String phone){
        return Login_reads_Count_key + phone;
    }


}
